﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KeyManagement.aspx.cs" Inherits="backstage_KeyManagement" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
<form id="form1" runat="server">
    <table>
        <tr>
            <td>
                <asp:ObjectDataSource ID="SourceKeys" runat="server" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="GetKeys" 
                    TypeName="KeyDB"></asp:ObjectDataSource>
                <asp:GridView ID="KeyGridView" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" DataSourceID="SourceKeys">
                    <Columns>
                        <asp:BoundField DataField="KeyId" HeaderText="KeyId" SortExpression="KeyId" />
                        <asp:BoundField DataField="Content" HeaderText="Content" 
                            SortExpression="Content" />
                        <asp:CheckBoxField DataField="IsInUse" HeaderText="IsInUse" 
                            SortExpression="IsInUse" />
                        <asp:BoundField DataField="DBPre" HeaderText="DBPre" SortExpression="DBPre" />
                        <asp:BoundField DataField="UsageType" HeaderText="UsageType" 
                            SortExpression="UsageType" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="Label1" runat="server" Text="生成临时key"></asp:Label>
                        </td>
                        <td>
                            <asp:Button ID="TempBtn" runat="server" Text="生成" onclick="TempBtn_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text="生成永久key"></asp:Label>
                        </td>
                        <td>
                            <asp:Button ID="PermBtn" runat="server" Text="生成" onclick="PermBtn_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="生成具有有效期限的key"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="Days" runat="server"></asp:TextBox>
                            <asp:Button ID="TermBtn" runat="server" Text="生成" onclick="TermBtn_Click" />
                            <asp:RegularExpressionValidator ID="DaysRegularExpressionValidator" runat="server" 
                                ErrorMessage="RegularExpressionValidator" ForeColor="Red" 
                                ControlToValidate="Days" ValidationExpression="\d+">输入的不是数字</asp:RegularExpressionValidator>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
